<template>
  <div class="auditHistoryDiv">
    <el-table
      ref="singleTable"
      :data="auditHistoryData"
      tooltip-effect="dark"
      @row-contextmenu="rowContextmenu"
      height="200"
      style="width: 100%">
      <el-table-column
        width="50"
        align="center"
        label="序号">
        <template slot-scope="scope">
          <span>{{scope.$index + 1}}</span>
        </template>
      </el-table-column>
      <el-table-column
        width="200"
        prop="name"
        align="left"
        :show-overflow-tooltip="showOverflowTooltip"
        label="环节名称">
      </el-table-column>
      <el-table-column
        width="100"
        prop="currentStatusName"
        align="center"
        :show-overflow-tooltip="showOverflowTooltip"
        label="审核状态">
      </el-table-column>
      <el-table-column
        width="100"
        prop="auditUserName"
        align="center"
        :show-overflow-tooltip="showOverflowTooltip"
        label="审核人">
      </el-table-column>
      <el-table-column
        width="150"
        prop="arriveTime"
        align="center"
        label="到达时间">
      </el-table-column>
      <el-table-column
        width="150"
        prop="auditTime"
        align="center"
        label="审核时间">
      </el-table-column>
      <el-table-column
        width="150"
        prop="auditDesc"
        align="left"
        :show-overflow-tooltip="showOverflowTooltip"
        label="审核意见">
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
  export default {
    name: 'workFlowAuditHistoryCom',
    data() {
      return {
        loading: false,
        showOverflowTooltip: true,
        auditHistoryData: []
      }
    },
    props: ['busiTypeId', 'busiId'],
    created() {
      // this.getWfProcessAuditHistory()
    },
    watch: {
      busiId() {
        this.getWfProcessAuditHistory()
      }
    },
    methods: {
      rowClick(row, event, column) {
        // 行单击事件
      },
      cellClick(row, column, cell, event) {
        // 列单击事件
      },
      rowContextmenu(row, column, e) {
        // 右键菜单
        window.event.returnValue = false
      },
      getWfProcessAuditHistory() {
        let args = {}
        args.businessId = this.busiId
        if (this.busiTypeId) {
          args.busiTypeId = this.busiTypeId
        } else {
          args.busiTypeId = ''
        }
        this.$store.dispatch('WfProcessAuditHistory', args).then(res => {
          let data = res.data
          this.auditHistoryData = data
          this.loading = false
        }).catch((err) => {
          console.log(err)
        })
      }
    }
  }
</script>
<style scoped>
  .auditHistoryDiv {
    border: 1px solid #ccc;
    padding:0px 0px 0px 0px;
    margin:0px 0px 0px 0px;
    position: relative;
  }
</style>
